package org.vectrics.mail;

import org.w3c.dom.*;
import org.apache.log4j.Category;

public class MailerConfig {
    private static Category log = Category.getInstance(MailerConfig.class);

    public MailerConfig() {
    }
    private String smtpAddress;
    private String popAddress;
    private String user;
    private String password;

    public String getSmtpHost() {
        return smtpAddress;
    }
    public void setSmtpHost(String smtpAddress) {
        this.smtpAddress = smtpAddress;
    }
    public void setPopHost(String popAddress) {
        this.popAddress = popAddress;
    }
    public String getPopHost() {
        return popAddress;
    }
    public void setUser(String user) {
        this.user = user;
    }
    public String getUser() {
        return user;
    }
    public void setPassword(String password) {
        this.password = password;
    }
    public String getPassword() {
        return password;
    }

    public void loadXml(Element mailerElement) {
        smtpAddress = mailerElement.getAttribute("smtp-host");
        popAddress = mailerElement.getAttribute("pop-host");
        user = mailerElement.getAttribute("pop-host");
        password = mailerElement.getAttribute("password");
        if (log.isDebugEnabled()) {
            log.debug("loadXml() - smtpHost = " + smtpAddress);
            log.debug("loadXml() - popHost  = " + popAddress);
            log.debug("loadXml() - user = " + user);
        }
    }
}